﻿using System;

namespace TimeToGo.Formatters
{
    internal class TimeDurationFormatter : DurationFormatterBase
    {
        public TimeDurationFormatter(string formatString)
            : base(formatString)
        { }

        public override string Name
        {
            get { return "Time formatter"; }
        }

        protected override string FormatDuration(TimeSpan duration)
        {
            return string.Format(FormatString, Math.Abs(duration.Days), Math.Abs(duration.Hours), Math.Abs(duration.Minutes), Math.Abs(duration.Seconds));
        }
    }
}
